﻿/*====================================================================================================
	TASK 7:                                                                                   {Loop's}
	Write a program that reads a number N and calculates the sum of the first N members
    of the sequence of Fibonacci:  0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, … 
    Each member of the Fibonacci sequence (except the first two) is a sum of the previous two members.
====================================================================================================*/

using System;
using System.Numerics;

class FirstNFibonacciMembers
{
    static void Main()
    {
        Console.Write("Enter N=");
        double n = double.Parse(Console.ReadLine());

        double nextMember;
        double sum = 1;
        double firstMember = 0;
        double secondMemeber = 1;

        for (int i = 1; i <= (n - 2); i++)
        {
            nextMember = firstMember + secondMemeber;
            sum = sum + nextMember;
            firstMember = secondMemeber;
            secondMemeber = nextMember;
            Console.WriteLine("0,1,{0}", nextMember);
        }

        Console.WriteLine(sum);
    }
}